package main

func main() {
	println(runningSum([]int{1, 2, 3, 4}))
}

func runningSum(nums []int) []int {

	sumArray := make([]int, 0, len(nums))

	sum := 0
	for i := range nums {
		sum = sum + nums[i]
		sumArray = append(sumArray, sum)
	}
	return sumArray
}
